<include file="Public:header" />
<div class="container no-bg" style="margin-top:-10px;">
	<div class="row">
		<div class="span2  bs-docs-sidebar mar-left3">
			<ul class="nav nav-list bs-docs-sidenav span2 widths" id="left_list" style="height:290px;">
				<li class="first-li"><span class="spans1"><img src="__PUBLIC__/img/house.png"/>日程详情</span></li>
				<li class="active"><a href="#tab1" data-toggle="tab">{:L('BASIC_INFO')}</a></li>
				<li><a href="#tab2">{:L('LOG')}&nbsp;&nbsp;<span class="badge badge-success"><if condition="$event['log_count']">{$event['log_count']}</if></span></a></li>
				<li><a href="#tab3">{:L('Attachment')}&nbsp;&nbsp;<span class="badge badge-success"><if condition="$event['file_count']">{$event['file_count']}</if></span></a></li>
			</ul>
		</div>
		<div class="span8 tab-content mar-lefts" >
			<div class="tab-pane fade in active" id="tab1" >
				<div class="container2 top-pad" >
					<a class="basic_information" name="tab">{:L('THE_SCHEDULE_FOR_DETAILS')}</a>
					<div class="pull-right"style="margin:-3px 15px 0 0;">
						<a class="btn btn-primary" href="{:U('event/edit', 'id='.$event['event_id'])}"/>{:L('EDITING')}</a>
						<a class="btn btn-primary" href="{:U('event/delete', 'redirect=1&id='.$event['event_id'])}" class="del_confirm">{:L('DELETE')}</a>
						<a class="btn btn-primary" href="javascript:void(0)" onclick="javascript:history.go(-1)">{:L('RETURN')}</a>
					</div>
				</div>
				<include file="Public:alert" />
				<div class="row-fluid" style="margin-top:10px;">
					<div class="container span12" style="margin-left:0px;">
						<table class="table table-hover">
							<tbody>
								<th <if condition="C('ismobile') eq 1">colspan="2"<else />colspan="4"</if>>{:L('BASIC_INFO')}</th>
								<tr>								
									<td class="tdleft" width="15%">{:L('THEME')}:</td>
									<td width="35%">{$event.subject}</td>
									<if condition="C('ismobile') eq 1"></tr><tr></if>
									<td class="tdleft" width="15%">{:L('OWNER_ROLE')}:</td>
									<td width="35%"><notempty name="event.owner.user_name"><a class="role_info" rel="{$event.owner.role_id}" href="javascript:void(0)">{$event.owner.user_name}</a></notempty></td>
								</tr>
								<tr>
									<td class="tdleft" >{:L('START_DATE')}:</td>
									<td><notempty name="event.start_date">{$event.start_date|date="Y-m-d",###}</notempty></td>
									<if condition="C('ismobile') eq 1"></tr><tr></if>
									<td class="tdleft" >{:L('END_TIME')}:</td>
									<td><notempty name="event.end_date">{$event.end_date|date="Y-m-d",###}</notempty></td>
									
								</tr>
								<tr>
									<td class="tdleft" >{:L('PLACE')}:</td>
									<td>{$event.venue}</td>
									<if condition="C('ismobile') eq 1"></tr><tr></if>
									<td class="tdleft">{:L('SEND_A_NOTIFICATION_EMAIL')}:</td>
									<td><if condition="$event.send_email eq 1">{:L('YES')}<else />{:L('NO')}</if></td>
								</tr>
								<notempty name="event.module.module_name">
									<tr>
										<td class="tdleft">{:L('CORRELATION')}{$event.module.module_name}</td>
										<td ><a href="{:U($event['module']['module'].'/view','id='.$event['module']['module_id'])}">{$event.module.name}</a></td>
										<!-- <td class="tdleft" >是否重复日程:</td>
										<td><if condition="$event.recurring eq 1">是<else />否</if></td> -->
										<if condition="C('ismobile') neq 1"><td colspan="2">&nbsp;</td></if>
									</tr>
								</notempty>
								<tr>
									<td class="tdleft" >{:L('DESCRIBE')}:</td>
									<td <if condition="C('ismobile') neq 1">colspan="3"</if>><if condition="$event['description']">{$event.description}</if></td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<div class="tab-pane fade back_box mar-top2" id="tab2" style="margin-top:-10px;">
				<div class="header1">
					<div class="pull-left two-title" >{:L('CORRELATION_LOG')}</div>
					<div class="pull-right"> 
						<if condition="$event['is_deleted'] neq 1">
							<a class="btn btn-primary add_log" href="javascript:void(0);" >{:L('ADD')}</a>
						</if>
					</div>
					<div style="clear:both;"></div>
				</div>
				<table class="table">
					<if condition="$event.log eq null">
						<tr>
							<td>{:L('THERE_IS_NO_DATA')}</td>
						</tr>
					<else />
						<volist name="event.log" id="vo">
							<tr>
								<td>
									<notempty name="vo.owner.user_name"><a class="role_info" rel="{$vo.owner.role_id}" href="javascript:void(0)">{$vo.owner.user_name}</a></notempty> &nbsp; 
									{$vo.create_date|date="Y-m-d  g:i:s a",###} &nbsp; 
									<notempty name="vo.create_date"> &nbsp; </notempty>
									<if condition="C('ismobile') eq 1"><br/></if>
									{$vo.subject}
								</td>
								<td>
									<if condition="$event['is_deleted'] neq 1"><a href="javascript:void(0)" rel="{$vo.log_id}" class="edit_log">{:L('EDITING')}</a>&nbsp; <a href="{:U('log/delete','r=REventLog&id='.$vo['log_id'])}" class="del_confirm">{:L('DELETE')}</a></if>
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<if condition="strlen($vo['content']) gt 100">
										<div id="slog_{$vo.log_id}">
										<pre>{$vo.content|msubstr=###,0,100}
										<a class="more" rel="{$vo.log_id}" href="javascript:void(0)">{:L('VIEW_FULL_INFO')}</a></pre>
										</div>
										<div id="llog_{$vo.log_id}" class="hide">
											<pre>{$vo.content}</pre>
										</div>
									<else/>
										<pre>{$vo.content}</pre>
									</if>
								</td>
							</tr>
						</volist>
					</if>
					
				</table>
			</div>
			<div class="tab-pane fade back_box mar-top2" id="tab3" style="margin-top:-10px;">
				<div class="header1">
					<div class="pull-left two-title" >{:L('RELATED_FILE')}</div>
					<div class="pull-right"> 
						<a class="btn btn-primary add_file" href="javascript:void(0);" >{:L('ADD')}</a>
					</div>
					<div style="clear:both;"></div>
				</div>
				<table class="table">
					<if condition="$event.file eq null">
						<tr>
							<td>{:L('FOUND_NO_RECORD')} </td>
						</tr>
					<else /> 
						<tr>
							<td>&nbsp;</td>
							<td>{:L('FILE_NAME')}</td>
							<td>{:L('SIZE')}</td>
							<if condition="C('ismobile') neq 1"><td>{:L('ADDED_BY')}</td>
							<td>{:L('ADD_TIME')}</td></if>
						</tr>
						<volist name="event.file" id="vo">
							<tr>
								<td class="tdleft"><a href="{:U('file/delete', 'id='.$vo['file_id'].'&r=REventFile')}" class="del_confirm">{:L('DELETE')}</a></td>
								<td>
									<a target="_blank" href="{$vo.file_path}">{$vo.name}</a>
								</td>
								<td>
									{$vo.size}{:L('BYTE')}
								</td>
								<if condition="C('ismobile') neq 1"><td>
									<notempty name="vo.owner.user_name"><a class="role_info" rel="{$vo.owner.role_id}" href="javascript:void(0)">{$vo.owner.user_name}</a></notempty></td>
								</td>
								<td>
									<notempty name="vo.create_date">{$vo.create_date|date="Y-m-d g:i:s a",###}</notempty>
								</td></if>
							</tr>
						</volist>
					</if>
				</table>
			</div>
		</div>
		<div class="span2  bs-docs-sidebar mar-lefts2" id="right_list" >
			<ul class="nav nav-list bs-docs-sidenav  span2 widths" >
				<li class="first-li"><span class="spans1">编辑详情</span></li>
				<li><a class="add_log" href="#tab2"><img src="__PUBLIC__/img/youce.png"/>&nbsp;&nbsp;&nbsp;{:L('ADD_LOG')}</a></li>
				<li><a class="add_file"  href="#tab3"><img src="__PUBLIC__/img/youce.png"/>&nbsp;&nbsp;&nbsp;{:L('ADD_Attachment')}</a></li>
			</ul>
		</div>
	</div>
</div>
<div class="hide" id="dialog-file" title="{:L('DIALOG_ADD_ATTACHMENTS')}">loading...</div>
<div class="hide" id="dialog-log" title="{:L('ADD_LOG')}">loading...</div>
<div class="hide" id="dialog-log-edit" title="{:L('DIALOG_EDIT_LOG')}">loading...</div>
<div class="hide" id="dialog-role-info" title="{:L('DIALOG_USER_INFO')}">loading...</div>
<script type="text/javascript">
	$('#left_list a').click(function (e) {
        e.preventDefault();
        $('#right_list').hide();
        $('#left_list').parent().next().removeClass('span8').addClass('span10');
        $(this).tab('show');
    });
    $('#left_list a:first').on('click', function (e) {
        $('#left_list').parent().next().removeClass('span10').addClass('span8');
        $('#right_list').show();
    });
<if condition="C('ismobile') eq 1">width=$('.container').width() * 0.9;<else/>width=800;</if>

$("#dialog-file").dialog({
    autoOpen: false,
    modal: true,
	width: width,
	maxHeight: 400,
	position: ["center",100]
});
$("#dialog-role-info").dialog({
    autoOpen: false,
    modal: true,
	width: width,
	maxHeight: 400,
	position: ["center",100]
});
$("#dialog-log-edit").dialog({
    autoOpen: false,
    modal: true,
	width: width,
	maxHeight: 400,
	position: ["center",100]
});
$("#dialog-log").dialog({
    autoOpen: false,
    modal: true,
	width: width,
	maxHeight: 400,
	position: ["center",100]
});
$(function(){
	$(".add_file").click(function(){
		$('#dialog-file').dialog('open');
		$('#dialog-file').load('{:U("file/add", "r=REventFile&module=event&id=".$event["event_id"])}');
	});
	$(".add_log").click(function(){
		$('#dialog-log').dialog('open');
		$('#dialog-log').load('{:U("log/add", "r=REventLog&module=event&id=".$event["event_id"])}');
	});
	$(".edit_log").click(function(){
		$log_id = $(this).attr('rel');
		$('#dialog-log-edit').dialog('open');
		$('#dialog-log-edit').load('{:U("log/edit","id=")}'+$log_id);
	});
	$(".role_info").click(function(){
		$role_id = $(this).attr('rel');
		$('#dialog-role-info').dialog('open');
		$('#dialog-role-info').load('{:U("user/dialoginfo","id=")}'+$role_id);
	});
	$(".more").click(function(){
		log_id = $(this).attr('rel');
		$('#llog_'+log_id).attr('class','');
		$('#slog_'+log_id).attr('class','hide');
	});
});
</script>
<include file="Public:footer" />